<template>
    <div>
      <h1>OSTree升级模块界面</h1>
      <div v-if="isAuthenticated">
        <p>Welcome, {{ user.username }}</p >
        <button @click="logout">Logout</button>
      </div>
      <div v-else>
        <router-link to="/login">登录<br></router-link>
        
        <router-link to="/register">注册</router-link>
      </div>
    </div>
  </template>
  
  <script>
  import { mapGetters, mapActions } from 'vuex';
  
  export default {
    computed: {
      ...mapGetters(['isAuthenticated', 'user'])
    },
    methods: {
      ...mapActions(['logout'])
    }
  };
  </script>